/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package serveur;

import Converters.NettyConverter;
import core.Emetteur;
import core.NetPaquet;
import org.jboss.netty.bootstrap.ServerBootstrap;
import org.jboss.netty.channel.Channel;

/**
 *
 * @author MOI
 */
public class ServeurManager implements Emetteur{

    private ServerBootstrap sb;
    public ServeurManager(int port,NettyConverter proxy)
    {
        sb = ServeurBootstrap.creerServeur(port, proxy);
    }

    public void send(NetPaquet p) {
        Channel c = p.getSrc().getChannel();
        if(c.isWritable())
        {
            //Envoie de la réponse
            c.write(p.getData());
        }
    }
}
